package com.myapp.api.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

public class Dept {
    private Integer id;

    @NotBlank(message = "院系编号不能为空")
    @Size(min = 2, max = 20, message = "院系编号长度在 2 到 20 之间")
    @Pattern(regexp = "^[1-9]\\d*$", message = "院系编号必须为数字")
    private String did;

    @NotBlank(message = "院系名称不能为空")
    @Size(min = 2, max = 30, message = "院系名称长度在 2 到 30 之间")
    private String dname;

    @Size(min=0,max=255,message="院系介绍长度在 0 到 255 之间")
    private String dinfo;

    private Date createtime;

    private Date updatetime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did == null ? null : did.trim();
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname == null ? null : dname.trim();
    }

    public String getDinfo() {
        return dinfo;
    }

    public void setDinfo(String dinfo) {
        this.dinfo = dinfo == null ? null : dinfo.trim();
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
}